<div class="page">
	<div class="container_12">
		<?php echo $this->element('header');?>
<!-- -----CONTENT----------------------CONTENT--------------------------CONTENT----------------------------------CONTENT---------------------------- -->
		<div class="content grid_12">		
<!-- -------STRONA KURSU--------------------------------------------STRONA KURSU------------------------- -->
			<div class="galeria bg_color grid_12 alpha omega">
				<div class="left_side filmy grid_8 alpha">
					<h1><span>GALERIA</span> FILMÓW</h1>
						<table cellpadding="0" cellspacing="0" style="margin: 0px 20px; width: 620px;">	
						<?php
						foreach ($movies as $movie): ?>
						<tr>
							<td width="290"><iframe width="280" height="160" src="<?php echo $movie['Movie']['code']?>" frameborder="0" allowfullscreen></iframe></td>
							<td><h3><?php echo h($movie['Movie']['name']); ?></h3><p><?php echo h($movie['Movie']['description']); ?></p></td>
						</tr>
						<?php endforeach; ?>
						</table>
						<div class="paging">
						<?php
							echo $this->Paginator->prev('< ' . __d('movies','previous'), array(), null, array('class' => 'prev disabled'));
							echo $this->Paginator->numbers(array('separator' => ''));
							echo $this->Paginator->next(__d('movies','next') . ' >', array(), null, array('class' => 'next disabled'));
						?>
						</div>
	
					<div class="clear"></div>		
				</div>
					<div class="right_side grid_4 omega">
						
						<h2><span>NAJNOWSZE</span> GALERIE</h2>
						<div class="list_gallery">
							<?php
							if(isset($galleries) && !empty($galleries)){
							foreach ($galleries as $gallery){ ?>
							<div class="single_gallery">
								<?php 
									if(!empty($gallery['Upload']['name'])){
// 										echo $this->Html->link(
// 												$this->Html->image($this->FileUpload->image($gallery['Upload']['name'],array('width'=>105,'imagePathOnly'=>true),array('alt'=>h($gallery['Gallery']['name'])))),
// 											array('controller'=>'galeria','action'=>$gallery['Gallery']['slug']),array('escape'=>false));
										echo $this->Html->link('',array('controller'=>'galeria','action'=>$gallery['Gallery']['slug']),array('escape'=>false,'title'=>$gallery['Gallery']['name'],'style'=>"float: left; ,display: block; background: url('{$this->FileUpload->image($gallery['Upload']['name'],array('autoResize'=>true,'imagePathOnly'=>true, 'imageNoSpacebar'=>true, 'width'=>100))}') no-repeat center center; width: 100px; height: 100px;"));
									}else{
										echo $this->Html->image('logo_terapio.png',array('width'=>105,'alt'=>h($gallery['Gallery']['name']),'title'=>h($gallery['Gallery']['name'])));
									}
								?>
								<div class="description">
									<p class="opis"><?php echo $this->Html->link(h($gallery['Gallery']['name']),array('controller'=>'galeria','action'=>$gallery['Gallery']['slug']),array('escape'=>false)); ?></p>
									<p class="date"><?php echo h($gallery['Gallery']['date']); ?></p>
									<p class="description"><?php echo $this->Text->truncate(  $gallery['Gallery']['description'], 100,
									 	array(
										        'ellipsis' => '...',
										        'exact' => false
										    )
										); ?></p>
								</div>
								<div class="clear"></div>
							</div>
							<div class="horizonatal_separator"></div>
							<?php }}?>						

							
						</div>
						
					</div>
				</div>
			<div class="clear"></div>
<!---------FOOTER----------------------FOOTER-----------------------------FOOTER-----------------------------------FOOTER----------------------------->
			<?php echo $this->element('footer')?>		
	</div>
</div>